package cn.shopping.service.impl.advertising;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.shopping.dao.advertising.AdvertissingMapper;
import cn.shopping.pojo.Advertising;
import cn.shopping.pojo.Sh_two;
import cn.shopping.service.advertising.AdvertisingService;

@Service
public class AdvertisingServiceimpl implements AdvertisingService{

	@Autowired
	private AdvertissingMapper advertissingMapper;
	
	
	@Override
	public List<Sh_two> getallofland() {
		return advertissingMapper.allofland();
	}


	@Override
	public boolean addAdvertising(Advertising advertising) {
		boolean flag = false;
		if (advertissingMapper.addAdvertising(advertising)>0) {
			flag = true;
		}
		return flag;
	}


	@Override
	public List<Advertising> getAdvertising() {
		return advertissingMapper.selAdvertising();
	}


	@Override
	public boolean delAdvertising(int id) {
		boolean flag = false;
		if (advertissingMapper.delAdvertising(id)>0) {
			flag=true;
		}
		return flag;
	}


	@Override
	public Advertising getAdvertisingbyid(int id) {
		return advertissingMapper.selAdvertisingbyid(id);
	}


	@Override
	public boolean updAdvertising(Advertising advertis) {
		
		boolean flag = false;
		if (advertissingMapper.updAdvertising(advertis)>0) {
			flag=true;
		}
		return flag;
	}

	
}
